﻿using System;

namespace Storyteller.Framework.Graphics.Particles.EmitModifiers
{
	public class RandomColorEmitModifier : ParticleEmitModifier
	{
		public Color MinimumColor { get; set; }
		public Color MaximumColor { get; set; }

		public RandomColorEmitModifier()
		{
			random = RandomUtil.Random;

			MinimumColor = Color.Black;
			MaximumColor = Color.White;
		}

		public override void Process(Particle[] particles, int offset, int count)
		{
			for (int i = 0; i < count; i++)
			{
				particles[i + offset].Color = random.NextColor(MinimumColor, MaximumColor);
			}
		}

		Random random;
	}
}
